home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
edit
/
wced19c.zip
/
WCED.DOC
< prev
next >
Wrap
Text File
|
1994-09-10
|
13KB
|
411 lines
Wced 1.9c Command Line Editor
Copyright (C) 1990-1994 Stuart Russell (WormSoft)
Introduction
------------
Wced is a command line editor. Features include a history of
commands typed, aliasing of commands (with parameters), filename
completion and command line editing. The main aim of Wced is to
improve the command line editing of DOS but use as little memory as
possible. When installed, wced uses approximately 14k of
conventional memory. Wcedlite performs like Wced but has no alias
functions.
Important
---------
In order for some of Wced's functions to work Wced must be in a directory
that is specified in the PATH. A very cryptic message is displayed by DOS
if this is not the case!!
Wced takes a copy of the PATH to use when performing CompShowPath. Before
loading Wced the PATH should contain all the directories to be searched
when performing CompShowPath.
Command Line Options
--------------------
Usage
wced [-acdflqt] [-wmethod] [-Hsize] [-Asize] [-S] [filename]
Options
a - Filenames are listed in alphabetical order.
c - Makes the history list circular. Normally command completion
stops at either end of the history list.
d - Directories in lists have a trailing '\'.
f - Treat the first word specially when using CompleteShow. See Filename
Completion.
l - All filenames are listed in lowercase.
q - The bell is not sounded when the start or end of the
history list is reached.
t - Translate the wced command buffer to make it DOS compatible.
See Removing the Trailing Slash.
w - This describes the method used to move between words. See Word
Method.
H - This specifies the size of the history buffer. See History and Alias
Size.
A - This specifies the size of the alias table. See History and Alias
Size.
S - Save the history and aliases to the specified file. See Saving the
History and Aliases.
Word Method
-----------
The 'w' option controls how Wced interprets words. This affects the
MoveWordLeft, MoveWordRight and DeleteWordLeft keys. There are currently
four methods.
0 Wced (default)
Words are delimited by changes between white-space, alphanumerics and
punctuation.
1 Unix
Words are delimited by changes between white-space and other characters.
2 Edit
A word is any non white-space and the white-space preceeding or following
it depending on the direction of movement.
3 Emacs (Bash)
A word begins with an alphanumeric.
History and Alias Size
----------------------
The size is specified in bytes but is rounded down to the nearest
paragraph, 16 bytes, when the space is allocated. Hence the maximum
size is 32572 bytes. The minimum size for the History List is 512
bytes. The minimum size for the Alias Table is 256 bytes.
The default size of the History List is 2048 bytes. The default size
of the Alias Table is 1024 bytes.
Saving the History and Aliases
------------------------------
The history and aliases are saved to the specified file in the
correct format to be read in by a later invocation of Wced. Wced does
not become resident and the other options are ignored.
Reading Initial Commands and Aliases
------------------------------------
If a filename exists on the command line Wced will attempt to read
initial commands and/or aliases from the file. The alias definitions
within the file have the following format:
alias aliastext fulltext
For example, 'alias d dir %*' aliases 'd' to 'dir'. Subsequently, if
'd' is the first word on the command line then it is substituted with
'dir'.
Any line not beginning with 'alias' is treated as a command and is
placed into the history list.
Alias Parameters
----------------
The aliases can have parameters in their definitions. For
example,
alias ld hotdir %0 /d/2
aliases 'ld' to 'hotdir %0 /d/2'. The %0 will be replaced with the
first argument given on the command line, ie.
C:>ld list.*
will result in DOS executing
hotdir list.* /d/2
Another example shows how all arguments can be used.
alias del del %* /p
This aliases 'del' to 'del %* /p'. The %* will be replaced by all
arguments on the command line, ie.
del tom dick harry
will result in DOS executing
del tom dick harry /p
The parameters can also be used in definitions entered from the
command line (as described below).
The Editing and History functions
---------------------------------
The default editing and history keys are :
MoveBegin Home Move to beginning of command line
MoveEnd End Move to end of command line
MoveRight Right Arrow Move cursor right one place along command line
MoveLeft Left Arrow Move cursor left one place along command line
MoveWordLeft Ctrl-Left Move cursor left to end of word
MoveWordRight Ctrl-Right Move cursor right to end of word
HistoryLast Up Arrow Move backwards (older) through history
HistoryNext Down Arrow Move forwards (newer) through history
DeleteLine Alt-d Delete entire command line
DeleteThis Del Delete character under cursor on command line
DeleteLast BS Delete character before cursor on command line
Quit Alt-x Quit and uninstall Wced
HistoryRemove Alt-r Remove entry on command line from history
Version Alt-v Print version
DeletetoBegin Alt-b Delete to beginning of command line
DeletetoEnd Alt-e Delete to end of command line
NoExecute Ctrl-c Store but do not execute command on command line
DeleteWordLeft Ctrl-BS Delete the word to the left of the cursor
Each function can have two keys assigned to it.
Wced only operates in insert mode - there is no overtype mode.
The history commands will attempt to complete the command on the
command line. An example is shown below.
Assume the history contains
ls
cd backup
less nogood
larn
worm <--- Most recent
If the user now does
C:>l_<UPARROW>
then the command line will be completed as
C:>larn_
with the cursor on the end of the line.
If the <UPARROW> is pressed again the command line becomes
C:>less nogood_
and again ...
C:>ls_
The cursor is always placed at the end of the line. The feedback
I have received suggests that people prefer this. If Wced can not
complete the command it will sound the bell assuming the 'q' flag
has not been specified.
The Alias functions (NOT available in wcedlite)
-----------------------------------------------
The alias functions of wced are accessed using Alt-a. The action
taken depends on the contents of the command line. If the command
line is empty then a list of current aliases is printed. If the
command line contains only one word then this is assumed to be an
alias that is to be removed from the alias table. If the alias
can not be matched then an error message is printed. If the
command line contains more than one word then the alias is added
to the alias table replacing a previous alias if necessary. Some
examples follow.
Adding:
C:>l ls %*<ALT-a>
C:>pkv pkunzip -vb %*<ALT-a>
This adds the aliases l and pkv to the alias table.
Listing:
C:><ALT-a>
l = ls %*
pkv = pkunzip -vb %*
This prints the current aliases.
Deleting:
C:>l<ALT-a>
This deletes an entry from the alias table.
C:><ALT-a>
pkv = pkunzip -vb %*
Aliases may contain multiple commands seperated by the ComSep
character(s). These can be changed using Wkeys.
For example:
C:>cd cd %0 ^ls<ALT-a>
C:>cd fred<Return>
This will change into the directory 'fred' and then list the files in the
directory.
NOTE: The space between %0 and ^ above is very important. If the argument
replacing %0 has a trailing slash then the space ensures it will be removed,
assuming Wced was invoked with the 't' option.
Filename Completion/Show
------------------------
The filename completion/show functions are assigned to :
Show Alt-s Show possible filename completions
CompShow Tab Attempt to complete filename/show possible
completions
CompShowPath Ctrl-Tab Complete/Show matching files on PATH
Filenames will be completed as far as possible. When the
completion becomes ambiguous the possible matching files
will be displayed. For example consider the following files.
backup\ buffer.c buffer.h buffer.obj
list.c list.h list.obj
wced.exe wced.doc wced17.zip
Pressing <Tab> on an empty line will produce a listing of the
entire directory contents.
C:><Tab>
backup\ list.c wced.doc
buffer.c list.h wced.exe
buffer.h list.obj wced17.zip
buffer.obj
The filename completion only completes the filename that the
cursor is at the end of. In the next example files beginning with
'b' are searched for and the 'less ' is ignored.
The filename can not be completed further so the possiblities are
listed.
C:>less b<Tab>
backup\ buffer.c buffer.h buffer.obj
The command line is unaltered and ready for more of the filename
to be given.
C:>less b_
C:>less bu<Tab>
Now the 'u' has been given the filename can be completed further.
C:>less buffer._
The filename again can not be completed further so the
possibilities are listed.
C:>less buffer.<Tab>
buffer.c buffer.h buffer.obj
C:>less buffer._
The user adds the required extension in this case.
C:>less buffer.h
If a filename is completed uniquely a space is added after the name.
If a directory is completed uniquely a backward slash is added after
the name.
The 'f' option alters the behaviour of CompleteShow (Tab). If this
option has been specified then when the cursor is at the end of the
first word on the line and the CompleteShow key is pressed a
CompleteShowPath is performed. You would normally have to use
CompleteShowPath (Ctrl-Tab) to do this.
If the filename contains wildcards, * or ?, then the possible
completions are listed when CompShow (Tab) or Show (Alt-s) is performed.
Removing the Trailing Slash
---------------------------
When using Filename Completion it is possible to complete a name such that
it has a trailing slash. For example,
C:>cd fred\_
If this line is passed to DOS 'cd' will moan and say something like
'Invalid directory'. This is because of the trailing slash. If you do not
have a 'cd' command that is clever then you can specify the 't' option.
This removes the trailing slash when necessary. For example,
C:>cd fred\ becomes C:>cd fred
C:>copy *.* a:\ stays as C:>copy *.* a:\
C:>cd \ stays as C:>cd \
C:>cd \fred\sid\ becomes C:>cd \fred\sid
Using Wced with Windows
-----------------------
There are two options when using Wced with Windows. By default if Wced
is installed before starting Windows then every command typed in a
DOS window is available in every other DOS window.
Instead of having one Wced for all DOS windows it is possible to have
a Wced for each DOS window. To achieve this, change system.ini as
below :
[NonWindowsApp]
localtsrs=dosedit,wced
This makes a copy of the TSRs specified for each DOS window.
Acknowledgements
----------------
Any comments, problems or suggestions for additions should be
mailed to
Stuart Russell
Woodlands
Back Lane
Meriden
Coventry
CV7 7LD
You can fax to + 44 676 534572. Please mark the fax clearly for the
attention of Stuart Russell at PRS.
Many, many thanks to all those people who took the trouble to
comment and suggest improvements for Wced. Special thanks to Matthijs.
Wkeys (v3.1) key programmer for Wced.
-------------------------------------
The Wced program is accompanied by a program called Wkeys. This
allows Wced's keys to be reprogrammed to suite the user. Wkeys allows
the use of the extended keys, ie F11, on an extended keyboard. The keys
are defined in a data file. An example is supplied.
Usage:
wkeys [ datafile [ exefile ] ]
If an error occurs the exe file will not be updated. Hopefully a
helpfull error message will be printed to highlight the problem
in the input.
If no input files are supplied then 'defaults.dat' and 'wced.exe'
are assumed.
The CommandSeparator can be set to a one or two character string using
any of '^&()~{}@'.
Each function can have two keys assigned to it.